package org.yufan.result;

/**
 * Created by zxd on 2018/3/27.
 */
public class ResultUtils {

    /**
     * 返回成功 不带数据
     */
    public static Result buildSuccess(){
        Result result=new Result();
        result.setStatus("success");
        return result;
    }
    /**
     * 返回成功 带数据
     */
    public static Result buildSuccess(Object object){
        Result result=new Result();
        result.setStatus("success");
        result.setData(object);
        return result;
    }

    /**
     *
     * @param code  错误编码
     * @param message  错误的具体信息
     * @return
     */
    public static Result buildFail(Integer code,String message){
        Result result=new Result();
        result.setStatus("fail");
        result.setCode(code);
        result.setMessage(message);
        return result;
    }



}
